package Test;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Te {
	
	public static void main(String[] args) {
	    String dateString = "2012-12-06 ";  
	    try  
	    {  
	        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd ");  
	        Date date =  sdf.parse(dateString);  
	        System.out.println(date);
	    }  
	    catch (ParseException e)  
	    {  
	        System.out.println(e.getMessage());  
	    }  
	}

}
